package com.mindskip.xzs.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mindskip.xzs.domain.Exam;
import com.mindskip.xzs.viewmodel.IdNameKV;
import com.mindskip.xzs.viewmodel.admin.exam.ExamRankInfoVM;
import com.mindskip.xzs.viewmodel.admin.exam.PageExamReq;
import com.mindskip.xzs.viewmodel.admin.exam.PageExamRes;
import com.mindskip.xzs.viewmodel.admin.exam.UnExamNoticeInfoVM;
import com.mindskip.xzs.viewmodel.student.exampaper.ExamInfoRes;
import com.mindskip.xzs.viewmodel.student.exampaper.PageExamInfoReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ExamMapper extends BaseMapper<Exam> {
   List<String> queryCategoryList(String keyword);
   List<PageExamRes> pageExamList(@Param("req") PageExamReq pageExamReq);
   List<IdNameKV> queryExamKVList();
   List<IdNameKV> queryUnexaminUserKVList(@Param("examId") Integer examId);
   List<UnExamNoticeInfoVM> queryUnexaminNoticeInfo(@Param("examId") Integer examId);
   List<ExamInfoRes> queryExamInfoList(PageExamInfoReq pageExamInfoReq);

   /**
    * 查询考试限制，返回结果 >0 则还能继续考试
    */
   Integer queryExamLimit(Integer userId, Integer examId);

   List<ExamRankInfoVM> queryExamRankNoticeInfo(@Param("examId") Integer examId);
}
